package Day08_2;

import java.util.Random;

public class Random_Test {
    public static void main(String[] args) {
        Random r1 = new Random();
//
//        for (int i = 0; i < 20; i++) {
//            int num1 = r1.nextInt(6);
//            System.out.print(num1 +"  ");
//            if(i==10)
//                System.out.println();
//        }
        int[] arr = new int[5];
        boolean bool = false;
        for(int i = 0; i < arr.length; i++){
            int num = r1.nextInt(10);
            for (int j = 0; j < arr.length; j++) {
                if(arr[j] != num){
                  bool=true;
                }
            }
            if(bool) {
                arr[i] = num;
            }
        }
        //输出
        for (int i = 0; i < arr.length; i++) {
            System.out.print(arr[i]+" ");
        }

    }
}
